package com.zy.ivideo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.time.LocalDate;
import java.util.Date;

@Entity
@EntityListeners(AuditingEntityListener.class)
@Data
@ApiModel(value = "点赞实体类",description = "点赞实体类")
@Table(name = "b_agree")
public class AgreeEntity {
    @ApiModelProperty(value = "主键id",position = 16,example = "0")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;

    /**
     * item 标识 本项目采用 verifycode
     */
    @ApiModelProperty(value = "item 标识 本项目采用 verifycode",position = 16,example = "0")
    @Column(length = 100,nullable = false)
    private String itemcode;

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id",position = 16,example = "0")
    @Column()
    private long userid;

    /**
     * 数据来源标识
     */
    @ApiModelProperty(value = "数据来源 0-Simple表 1-Mutil表",position = 16,example = "0")
    @Column(name = "sourceflag",columnDefinition = "int DEFAULT 0 COMMENT '数据来源 0-Simple表 1-Mutil表 '")
    private int sourceflag;

    /**
     * 创建日期
     */
    @ApiModelProperty(value = "创建日期",position = 16,example = "2020-01-01 00:00:00")
    @CreatedDate
    @Column()
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ctime;

    @ApiModelProperty(value = "校验码",position = 16,example = "aaabbb")
    @Column(unique = true)
    private String verifycode;
}
